package com.example.universita.esami;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class MainActivity extends Activity {
	

	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
       
        
    }
    

	@Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    
    public void CaricavotiActivity(View v) { 

    	Intent intent = new Intent(this, Caricavoto.class);
    	startActivity(intent); 
    }
    
    public void CaricaparzialeActivity(View v) { 

    	Intent intent = new Intent(this, Caricaparziale.class);
    	startActivity(intent); 
    }
    
    public void ProceduraGuidata(View v) { 
    	Intent intent = new Intent(this, ProceduraGuidata.class);
    	startActivity(intent); 
    }
    
    public void StatisticActivity(View v) { 

    	Intent intent = new Intent(this, StatisticActivity.class);
    	startActivity(intent); 
    }
    
    public void Cercaesami(View v){
    	final String[] options = { "ARE", "FDI","PR1" }; 
    	AlertDialog.Builder builder = new AlertDialog.Builder(this); 
    	builder.setTitle("Scegli l' Esame"); 
    	builder.setItems(options, new DialogInterface.OnClickListener() { 

			public void onClick(DialogInterface dialog, int which) { 
		    	  String option = options[which];
		    	  
		    	  Intent intent = new Intent(getBaseContext(), CercaEsamiActivity.class);
		    	  intent.putExtra("Esame", option);
		    	  startActivity(intent);
	    	}
	    	
    	}); 
    	builder.setCancelable(false); 
    	AlertDialog alert = builder.create();
    	alert.show();
    	
    }
}
